﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CnGine.Comm;

public partial class admin_feelingadd : LoginBase
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string title = txtTitle.Text.Trim();
        string tag = txtTag.Text.Trim();
        string content = txtContent.Text.Trim();
        Model.Feelings feel = new Model.Feelings();
        feel.ClassID = "";
        feel.Title = title;
        feel.Tag = tag;
        feel.Content = content;
        feel.CommentNum = 0;
        feel.LoveNum = 0;
        feel.UserID = base.User.ID;
        feel.IsPass = true;
        feel.Hits = 0;
        feel.AddTime = DateTime.Now;
        if (new BLL.Feelings().Add(feel) > 0)
        {
            MessageBox.AlertAndRedirect("添加成功！", "feelingadd.aspx", this.Page);
        }
        else
        {
            MessageBox.Alert("添加失败，请重试！", this.Page);
        }
    }
}